
package com.scs.application.modules.upms.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.scs.application.core.serial.SerialRule;
import com.scs.application.core.service.IBaseService;
import com.scs.application.modules.upms.request.SerialRuleQueryRequest;

import java.util.List;

/**
* 编号规则 service 接口
*/
public interface SerialRuleService extends IBaseService<SerialRule> {

    List<SerialRule> list(SerialRuleQueryRequest request);


    IPage<SerialRule> page(SerialRuleQueryRequest request);

    /**
     * 同步编号规则到redis
     */
    void syncToCache();


    /**
     * 使用默认目标生成编号
     *
     * @param ruleCode
     * @return
     */
    String generateCode(String ruleCode);

    /**
     * 使用指定目标生成编号
     *
     * @param ruleCode
     * @param target
     * @return
     */
    String generateCode(String ruleCode, String target);

    /**
     * 批量生成编号
     * @param ruleCode
     * @param count
     * @return
     */
    List<String> batchGenerateCode(String ruleCode, int count);

    /**
     * 批量生成编号
     * @param ruleCode
     * @param target
     * @param count
     * @return
     */
    List<String> batchGenerateCode(String ruleCode, String target, int count);
}
